package com.pagoda.nerp.webapi.controller;

import com.pagoda.nerp.web.common.buildTree.Tree;
import com.pagoda.nerp.web.common.buildTree.TreeBuild;
import com.pagoda.nerp.web.entities.HRUnit;
import com.pagoda.nerp.web.services.EHRService;
import com.pagoda.nerp.web.services.HRUnitService;
import com.pagoda.nerp.webapi.hander.ResponseResult;
import org.apache.http.HttpResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.zip.GZIPOutputStream;

import static com.pagoda.nerp.erpgwehrApplication.posttree;
import static com.pagoda.nerp.erpgwehrApplication.unittree;

/**
 * This class was generated by the
 * JAX-WS RI 2.2.9-b130926.1035
 * Generated source version: 2.2
 */

@RestController
public class HRUnitController {
    @Autowired
    private EHRService ehrService;
    @Autowired
    private HRUnitService hrUnitService;

    @RequestMapping(value = "/getHRUnitTree",method = RequestMethod.GET)
    public ResponseResult getHRUnitTree(HttpResponse response,@RequestParam(value = "id",required = false,
            defaultValue = "901205ca-6c22-4ee7-ae4b-96cc7165d07f") String orguid) {
        return unittree;
    }

    @GetMapping(value = "/updatehrunit")
    public ResponseResult hrunit(){
        List<HRUnit> list = hrUnitService.updateDBUnit();
        return ResponseResult.success(list);
    }

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public String test()
    {
        return "HelloWorld！";
    }
}
